<%--已报名竞赛--%>
<%@ page import="org.subject.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入 jstl--%>
<%@include file="common/tag.jsp" %>
<!DOCTYPE html>
<%-- 获取资源根路径--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>个人中心</title>
    <%@include file="common/head.jsp" %>
    <script src="/./resource/js/list.js"></script>
    <style>
        a {
            color: #666;
        }

    </style>
    <style>
        .fl {
            float: left;
            display: inline;
        }

        .nav_module {
            margin-bottom: 15px;
        }

        .nav_module li {
            list-style: none;
        }

        .nav_module li.dt {
            height: 28px;
            line-height: 28px;
            font-weight: bold;
        }

        .nav_module ul li a {
            height: 28px; /*设置高度为28px*/
            line-height: 28px; /*设置行距为28px，让文字在每行的中间位置*/
            color: #000; /*文字颜色是白色*/
            margin: 5px 10px;
            font-size: 12px; /*用12号字*/
            display: block; /*这个比较关键，因为a本身就是联级元素，本身不具有宽高，用这个把它变成块级元素，这样前面设置的宽和高就能起作用了*/
            text-align: center; /*让文本居中*/
            text-decoration: none; /*去掉下划线*/
        }

        .b_mainBox_hd {
            /*line-height: 44px;
            padding-left: 15px;
            margin-bottom: 14px;*/
            color: #000;
            background: #000;
        }

        .b_mainBox_hd li {
            list-style: none;
            float: left;
        }

        .personnav {
            color: #1b5799;

            height: 40px;
            width: 100%;
            margin: 0px auto;
            text-align: center;
        }

        .bNav {
            margin-top: 10px;
            margin: auto;
            background: #F1F1F1;
            /*text-align:center;*/
        }

        .bNav ul {
            padding: 4px 20px;
            margin: 0;
            overflow: hidden;
        }

        .bNav ul li {
            display: inline;
            padding: 0;
        }

        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        #container {
            min-height: 100%;
            height: auto !important;
            height: 100%; /*IE6不识别min-height*/
            position: relative;
        }

        #page {
            width: 100%;
            margin-bottom: 50px; /*等于footer的高度*/
        }
    </style>
    <%
        User user = (User) session.getAttribute("user");
    %>
</head>
<body background="/./resource/images/bg.jpg" style="background-size: cover;background-repeat: no-repeat;">
<%--页面显示部分--%>
<div id="container" class="container">
    <jsp:include page="common/Top.jsp"/>
    <div id="page" class="panel panel-default">
        <div class="panel-heading" hidden>
            <h5>最新公告</h5>
        </div>
        <div class="panel-body">
            <!--左侧菜单-->
            <div class="col-md-2 fl">
                <ul class="nav_module">
                    <li class="dt">账号设置</li>
                    <li ng-hide="CurrentUser.IsShop"><a href="/user/detail?userId=<%=user.getUserId()%>">个人信息</a></li>
                </ul>
                <ul class="nav_module">
                    <li class="dt">竞赛信息</li>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 2 || user.getUserRole()==1}">
                            <li><a href="/message/publishHistory?userId=${user.userId}">发布竞赛历史</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 3}">
                            <li><a href="/regist/userhistory?userId=${user.userId}">已报竞赛</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 3}">
                            <li ng-hide="CurrentUser.IsShop"><a
                                    href="/regist/contestHistory?userId=${user.userId}">竞赛历史</a></li>
                        </c:when>
                    </c:choose>
                </ul>
            </div>
            <div class="col-md-10">
                <div class="bNav">
                    <ul>
                        <li><a href="/user/detail?userId=<%=user.getUserId()%>">个人中心</a></li>
                        <li><span> > </span></li>
                        <li>竞赛信息</li>
                        <li><span> > </span></li>
                        <li>已报竞赛</li>
                    </ul>
                </div>
                <br/>

                <div class="tab-content" style="margin-top: 20px;margin-left: 40px;">
                    <c:choose>
                        <c:when test="${sessionScope.user != null}">
                            <div class="col-md-12">
                                <form action="<%=basePath%>regist/exportExcel" method="post" hidden>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0"
                                           bgcolor="b5d6e6">
                                        <tr>
                                            <td><input type="text" name="messageId" value="${message.messageId}" hidden>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="10%" align="right">
                                                <input type="submit" value="导出报名用户数据"/>
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                                <table border="1" width="100%" class="bordercolor" style="margin-top: 20px">
                                    <thead>
                                    <tr bgcolor="#CBEAFA" align="center">
                                        <td align="center">序号</td>
                                        <td align="center">学号</td>
                                        <td align="center">姓名</td>
                                        <td align="center">竞赛名称</td>
                                        <td align="center">比赛时间</td>
                                        <td align="center">上传文件</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${registeUserMessages}" var="registeUserMessage"
                                               varStatus="status">
                                        <tr
                                                <c:if test="${status.index % 2 != 0}">style='background-color:#ECF6EE;'</c:if>>
                                            <td style="height:40px" align="center">${status.index + 1}</td>
                                            <td style="height:40px" align="center">${registeUserMessage.userNumber}</td>
                                            <td style="height:40px" align="center">${registeUserMessage.userName}</td>
                                            <td style="height:40px"
                                                align="center">${registeUserMessage.messageTitle}</td>
                                            <td style="height:40px" align="center"><fmt:formatDate
                                                    value="${registeUserMessage.startTime}" pattern="yyyy-MM-dd HH:mm"/>——
                                                <fmt:formatDate
                                                        value="${registeUserMessage.endTime}"
                                                        pattern="yyyy-MM-dd HH:mm"/>
                                            </td>
                                            <td>
                                                <c:choose>
                                                    <c:when test="${registeUserMessage.registrationRemark!=null}">
                                                        ${registeUserMessage.registrationRemark}<a
                                                            href="<%= basePath %>regist/dowload?address=${registeUserMessage.registrationRemark}">下载</a>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <form action="${pageContext.request.contextPath }/regist/upLoad?id=${registeUserMessage.registrationId}"
                                                              method="post" enctype="multipart/form-data">
                                                            文件:<input type="file" name="uploadFile"/>
                                                            <input type="submit" value="上传"/>
                                                        </form>
                                                    </c:otherwise>
                                                </c:choose>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                    <%--<div class='page fix pageNum'>
                                        共 <b>${page.totalNumber}</b> 条
                                        <c:if test="${page.currentPage != 1}">
                                            <a href="<%= basePath %>message/page?page=1" class='first'>首页</a>
                                            <a href="<%= basePath %>message/page?page=${page.currentPage-1}" class='pre'>上一页</a>
                                        </c:if>
                                        当前第<span>${page.currentPage}/${page.totalPage}</span>页
                                        <c:if test="${page.currentPage != page.totalPage}">
                                            <a href="<%= basePath %>message/page?page=${page.currentPage+1}" class='next'>下一页</a>
                                            <a href="<%= basePath %>message/page?page=${page.totalPage}" class='last'>末页</a>
                                        </c:if>
                                        跳至&nbsp;<input id="currentPageText" type='text' value='${page.currentPage}'
                                                       class='allInput w28'/>&nbsp;页&nbsp;
                                        <a href="javascript:changeCurrentPage($('#currentPageText').val())" class='go'>GO</a>
                                    </div>--%>
                            </div>
                        </c:when>
                    </c:choose>
                </div>
            </div>
        </div>
    </div>
    <jsp:include page="common/footer.jsp"/>
</div>
</body>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>